var code = [
	"成功", // 0
	"缺乏参数", // 1
	"用户名/密码错误", //2
	"用户名已存在", //3
	"没有这个接口", //4
	"token不存在或者过期", //5
	
	// 100开始的错误为自定义错误
];

function error(num,info){
	let info2 = info || code[num];
	return {errcode:num, errmsg:info2, record:''};
}

function success(obj){
	return {errcode:0, errmsg:'sccess', record:obj};
}

module.exports = {error,success};
